{include file="public/header" /}

<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{:lang('system setting')}
                        <!--<small>系统常用参数</small>-->
                    </h5>
                </div>
                <div class="ibox-content">
                    <form method="get" class="form-horizontal" id="form1">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{:lang('website name')}</label>
                            <div class="col-sm-10">
                                <input name="webName" type="text" class="form-control"
                                       value="{$systemSetting.webName|default=''}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{:lang('company name')}</label>
                            <div class="col-sm-10">
                                <input name="companyName" type="text" class="form-control"
                                       value="{$systemSetting.companyName|default=''}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">公司地址</label>
                            <div class="col-sm-10">
                                <input name="companyAddress" type="text" class="form-control"
                                       value="{$systemSetting.companyAddress|default=''}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">服务热线</label>
                            <div class="col-sm-10">
                                <input name="serviceHotLine" type="text" class="form-control"
                                       value="{$systemSetting.serviceHotLine|default=''}">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">备案信息</label>
                            <div class="col-sm-10">
                                <input name="recordInfo" type="text" class="form-control"
                                       value="{$systemSetting.recordInfo|default=''}"> <span
                                    class="help-block m-b-none">公司备案信息</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">版权信息</label>
                            <div class="col-sm-10">
                                <input name="copyrightInfo" type="text" class="form-control"
                                       value="{$systemSetting.copyrightInfo|default=''}"> <span
                                    class="help-block m-b-none">公司版权信息</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="button" onclick="doSubmit()">保存内容</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{include file="public/footer" /}
<script>
    function doSubmit() {
        $.ajax({
            url: "{:U('System/setting')}",
            type: 'post',
            data: $('#form1').serialize(),
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 1) {
                    layer.msg(data.msg);
                    setTimeout(function () {
                        location.reload();
                    }, 1000)
                } else {
                    layer.msg(data.msg);
                }
            }
        });
        return false;
    }
</script>
